Function Reference

_ArrayTrim

Trims all elements in an array a certain number of characters.

#include <Array.au3>
_ArrayTrim( $aArray, $iTrimNum [, $iTrimDirection], $iBase], $iUbound]]] )

 

Parameters

$aArray The array to trim the items of.
$iTrimNum The amount of characters to trim.
$iTrimDirection Optional: Default=0. 0 to trim left, 1 to trim right
$i_Base Optional: Start Array index for sort, normally set to 0 or 1.
$i_Ubound Optional: Set the UBound for sorting which will only sort the defined number of entries in stead of the whole array.

 

Return Value

0 If invalid array
1 Invalid base boundry parameter
2 Invalid end boundry parameter
3 If $iTrimDirection is not a zero or a one
Otherwise it returns the new trimmed array

 

Remarks

 None.

 

Related

None.

 

Example


#include <Array.au3>

Dim $avArray[5]
$avArray[0] = "ab"
$avArray[1] = "bc"
$avArray[2] = "cd"
$avArray[3] = "de"
$avArray[4] = "ef"

$aNewArray = _ArrayTrim( $avArray, 1, 1,1,3)
_ArrayDisplay($aNewArray,"demo _ArrayTrim")
Exit

;The new array in order should now be "a", "b" , "c" , "d", "e".